//
// Description: 5236. 美化数组的最少删除数
// Created by Loading on 2022/3/27.
//

#include <bits/stdc++.h>

using namespace std;

int minDeletion(vector<int> &nums) {
    int res = 0;
    int n = nums.size();
    for (int i = 0; i < n - 1; ++i) {
        if (nums[i] == nums[i + 1]) {
            ++res;
        } else {
            ++i;
        }
    }
    if ((n - res) % 2) {
        ++res;
    }

    return res;
}

int main() {
    vector<int> nums{1, 1, 2, 2, 3, 3};
    auto res = minDeletion(nums);
    cout << res << endl;

    return 0;
}